package edu.avans.hartigehap.domain;

import java.util.Collection;
import java.util.Locale;

import javax.persistence.Transient;

import org.springframework.ui.Model;

import edu.avans.hartigehap.web.controller.WebOrderController;

public class OrderedState extends WebState {

	WebOrder webOrder;
    WebOrderController webOrderController = new WebOrderController();
    Model uiModel;
    Locale locale;

	public OrderedState(WebOrder webOrder) {
		this.webOrder = webOrder;
	}

	public void addOrderItem(WebDish dish, Collection<WebOrderItem> orderItems) {
		if (uiModel == null)
		{
			System.out.println("modelnull");
		}
		if (locale == null)
		{
			System.out.println("localenull");
		}
		webOrderController.cannotBeAlteredMessage(uiModel, locale);
	}
	
	public void deleteOrderItem(WebDish dish, Collection<WebOrderItem> orderItems) {
		webOrderController.cannotBeAlteredMessage(uiModel, locale);
	}

	@Override
	@Transient
	public String getMessage() {
		return "Dit is het bericht dat je krijgt met OrderedState";
	}

	@Override
	public void changeState() {
		webOrder.setInprogressState();
		
	}

}
